home *** CD-ROM | disk | FTP | other *** search
/ Audio Version 4.94 / audioversion4.94knowledgemediaresourcelibraryoctober1994.iso / mac / midi / unsn062s.hqx / UniSon Manual (TEXT) < prev    next >
Text File  |  1991-12-11  |  37KB  |  557 lines

  1. This is a version of the original UniSon manual (which is a WriteNow document)
  2. saved as a TEXT file with line breaks. It is ugly, but readable.  -J. Bate
  3.  
  4.  
  5. UniSon 0.62
  6. User╒s Guide
  7.  
  8. UniSon is a software system which works in conjunction with a Sound Accelerator or 
  9. AudioMedia card available from Digidesign corporation. It allows the user to create sound 
  10. synthesis and signal processing algorithms by connecting functional units using a 
  11. graphical user interface. New devices can be created by the interconnection of existing 
  12. devices, or by writing 56001 DSP code ╥from scratch╙. 
  13.  
  14. Disclaimer:  This is still a very preliminary version of the system. There are large 
  15. sections which are missing completely (cutting and pasting, repositioning devices, stereo 
  16. outputs, etc.), known bugs, and much to do in the way of future expansion. Since this is a 
  17. part-time project for a single individual, progress is slow. Please send any comments, 
  18. suggestions, complaints, requests, ideas, etc. to:
  19.  
  20. Dr. John A. Bate
  21. Department of Computer Science
  22. 545 Machray Hall
  23. University of Manitoba
  24. Winnipeg, Manitoba, Canada
  25. R3T 2N2
  26.  
  27. Phone: (204) 474-6791
  28. FAX: (204) 269-9178
  29. Email: BATE@CS.UMANITOBA.CA
  30.  
  31. A Quick Tour of UniSon
  32.  
  33. To see the basic operation of the UniSon system, follow the steps outlined below.
  34.  
  35. 1.    Start up UniSon by double-clicking on its icon. An untitled file will be opened. Close it 
  36. using the ╥go away╙ box or by choosing ╥Close File╙ from the file menu. Open the file 
  37. ╥UniSon 0.62 Demo╙ instead using the ╥Open File╙ menu choice. 
  38. 2.    If using an AudioMedia card, select ╥use AudioMedia╙ under the ╥Circuit╙ menu. Choose 
  39. ╥Enable Card╙ from the ╥Circuit╙ menu. This will start up the signal processor. If this 
  40. doesn╒t work (because you don╒t have a card installed), you will still be able to do 
  41. everything, but you will get no sound (which is rather pointless, really).
  42. 3.    Select the ╥Manual FM╙ circuit from the ╥Circuits╙ half of the file window, and then 
  43. press the ╥Edit Circuit╙ button (or simply double-click on ╥Manual FM╙). You now have 
  44. an active UniSon circuit.
  45. 4. Click on the small ╥On/Off╙ button on the right side of the screen. You should hear a 
  46. simple two-operator FM tone. Try changing the carrier frequency, modulator frequency, 
  47. modulation index, and pitch by using the small slider controls. (Leave the 1/Pi control 
  48. alone, if you want the modulation index to be accurate.) Click on the two envelope 
  49. symbols to try different carrier and modulator envelopes. (Beware of problems here: this 
  50. is one area that still needs a lot of work.) 
  51.  
  52. This illustrates the concept of a circuit in UniSon. Each device showing on the screen in 
  53. the circuit window represents a block of DSP code which performs a certain function. A 
  54. device may have inputs and outputs, as well as internal controls which affect its 
  55. operation. Each connecting line represents a 44.1 kHz digital signal stream, and the DSP 
  56. code for each device is executed 44,100 times per second. Changes made to the controls 
  57. affect the signal processor instantly. Changes made to the circuit itself also result in 
  58. almost immediate reprogramming of the DSP. Here is how to construct a circuit of your 
  59. own:
  60.  
  61. 5.    Close the ╥Manual FM╙ window and return to the file window. Click on the ╥New 
  62. Circuit╙ button. This will create a new untitled circuit window.
  63. 6.    Click on the name ╥Output╙ in the list of device names in the bottom left-hand corner of 
  64. the window. An output device will appear in the ╥chute╙ above that list. Using the 
  65. mouse, drag that output device into the main part of the window, positioning it centered 
  66. at the bottom of the window. (In the current version, it is not possible to move a device. 
  67. It must be positioned properly the first time.)
  68. 7.    Click on the name ╥Cntl Sine╙ and place one of these devices above the output device but 
  69. not touching it. (Devices cannot be connected by simply placing them so that their pins 
  70. coincide. You must use a short ╥wire╙ to actually make a connection. I told you it needed 
  71. work!)
  72. 8. Connect the output pin of the Sine Oscillator to the input pin of the ╥Output╙ device. 
  73. (Press the mouse button with the cursor on or near the tip of the output pin. The cursor 
  74. should be a small cross. If it is an arrow, you are too far from the pin. Drag the mouse to 
  75. the tip of the input pin of the other device, and release the mouse button.)
  76. 9.    The upper scroll bar controls frequency and the lower one controls amplitude. Click on 
  77. the ╥units╙ boxes which currently contain ╥Dec╙ to change them to ╥Hz╙ and ╥dB╙, 
  78. respectively. Drag the longer sliders around to change the amplitude and frequency and 
  79. hear a nice pure sine wave. The shorter sliders control the sensitivity or range of motion 
  80. of the large sliders (from ultra-coarse to ultra-fine). 
  81. 10.    Click on the ╥scissors╙ icon in the top left corner. Delete the ╥Control Sine╙ device and 
  82. the short wire by zapping them with the lightning bolt. Select the ╥drawing╙ (hand 
  83. holding a pen) icon in the top left corner again.
  84. 11.    Create a simple MIDI-controlled sine wave voice (if you have MIDI input to your Mac) 
  85. using one each of the ╥Sine╙, ╥Output╙, ╥Multiply╙, and ╥MIDI Note╙ devices. (If you 
  86. have no MIDI input device, use two scroll bars and a button instead.) Connect the ╥f╙ 
  87. output of the MIDI device to the ╥f╙ input of the oscillator, connect the ╥A╙ and ╥Gate╙ 
  88. outputs to the two inputs of the multiplier, and connect the output of the multiplier to 
  89. the amplitude (╥A╙) input of the oscillator. Connect the sine oscillator output to the 
  90. output device. This version of UniSon supports (and requires) the MIDI Manager, and 
  91. so you should now use the ╥Patch Bay╙ to connect some source of MIDI data to UniSon. 
  92. Change the MIDI channel number by clicking on it, if desired, and then play your 
  93. circuit via MIDI. I think you get the idea now, right? 
  94.  
  95. This illustrates operation of the circuit window. You can create your own primitive 
  96. devices, however, and this is illustrated below.
  97.  
  98. 12.    Take a look at the ╥Manual FM.dev╙ circuit by opening it from the file window. Note 
  99. that it produces no sound, since there is no output device, nor is there a control for the 
  100. frequency or the ╥gate╙ (on/off). Instead, it contains devices called ╥Input Pins╙ and 
  101. ╥Output Pins╙ which simply give these signals names. These devices are available from 
  102. the same list as the oscillators, etc.
  103. 13.    Close the circuit window(s) and get back to the file window. Click the ╥New Device╙ 
  104. button. We will create a new device which encapsulates the entire ╥Manual FM╙ circuit. 
  105. First, you will need an appropriate picture. The HyperCard stack supplied contains an 
  106. appropriate picture (labelled ╥Manual FM Picture╙). Go and cut the picture from there. 
  107. (If you are not running multifinder or System 7 you will have to exit from UniSon and 
  108. then come back later, of course.) Make sure that the picture is cropped absolutely 
  109. precisely. The tips of the I/O pins must be exact multiples of 5 pixels away from the top 
  110. left corner of the picture. The background of the cards in the HyperCard stack is a 5 
  111. pixel grid to make this easy. Cut out the picture carefully.
  112. 14.    Once you have cut/copied your picture, get back to the device window in UniSon and 
  113. select ╥Paste╙. The picture should appear.
  114. 15.    Now we need to tell UniSon what this device is supposed to do. Click on the ╥Convert 
  115. Circuit╙ button and select the ╥Manual FM.dev╙ circuit from the list that is presented 
  116. to you.
  117. 16.    The device editor now knows the DSP code needed for this device, and what I/O pins 
  118. and internal controls it has. Now it must be told the positions of those pins and controls 
  119. in the graphical picture of the device. Click in turn on each pin name and position it by 
  120. clicking on the endpoints of the corresponding pins in the picture. Position all of the 
  121. controls similarly except for the ╥1/╣.bar╙ control. That is meant to be a constant which 
  122. the user should not be able to see or modify. The mouse controls the position of the top 
  123. left corner of each control. Note that the ╥Title╙ control automatically adjusts to use the 
  124. entire width of the device.
  125. 17.    Select the ╥Save Device As...╙ item from the File menu. It will warn you that you have 
  126. not used all the controls, but that is intentional. Click the ╥Go Ahead╙ button. Give 
  127. your device a name and then close the device window. Your new device should appear 
  128. at the top of the list in the ╥devices╙ half of the file window. TWO IMPORTANT 
  129. NOTES: UniSon does not currently warn you if you are about to lose something by 
  130. closing a window before you save it. Also, you are simply saving the device into the file 
  131. window at this point. You have not saved anything to disk until you save the file 
  132. window itself.
  133. 18.    Try out the new device. Open a new circuit window and use one of these devices. 
  134. Connect an ╥Output╙ device and either a MIDI input device or a scroll bar (set to ╥Hz╙) 
  135. and a button to the inputs. Try it out.
  136.  
  137. It is also possible to create a device directly from raw DSP code together with 
  138. specifications of the I/O pins, internal local storage requirements, and required controls, 
  139. but that is covered later. By now you should have a fair idea of the operation of UniSon. 
  140. Most of it is meant to be fairly simple to use, although it is as yet incomplete.
  141.  
  142. Reference Notes
  143.  
  144. 1. Menus
  145.  
  146. 1.1 Apple menu
  147. Contains the standard desk accessories and the usual ╥about╙ item.
  148.  
  149. 1.2 File menu
  150. ╥New File╙ and ╥Open File╙ allow UniSon data files to be created and accessed. A file 
  151. contains device definitions and circuits which use those devices. The ╥Save╙, ╥Save 
  152. As...╙ and ╥Close╙ items will change according to whether or not the top window is a 
  153. file window, a device window, or a circuit window.  Saving a file results in its being 
  154. written to disk. Saving a device or a circuit only results in its being saved into the 
  155. internal version of the file in memory. You must save the file itself before any changes 
  156. to devices or circuits become permanent. Note also that the system is not polite enough 
  157. to warn you when you are about to close something without saving it first. It gleefully 
  158. destroys your work instead. (Insert evil laugh here.) The ╥Quit╙ item is self-
  159. explanatory but the same warning applies. The ╥Revert╙ item is not implemented.
  160.  
  161. 1.3 Edit menu
  162. Unfortunately, this is largely unsupported. You use it with desk accessories, and to 
  163. paste pictures into the device window. You may also use ╥clear╙ to delete devices and 
  164. circuits from a file. Regrettably, cutting, copying, and pasted of devices, circuits, and 
  165. portions of circuits is not yet completed.
  166.  
  167. 1.4 Compile menu
  168. The ╥Compile╙ item forces UniSon to recompile the circuit in the top circuit window 
  169. and reload it into the Sound Accelerator. This is around only for debugging and 
  170. development reasons. Any change to a circuit automatically recompiles and reloads it 
  171. anyway. You should never need this menu item at all. The ╥Enable/Disable Card╙ item 
  172. will turn the Sound Accelerator or AudioMedia on and off. (Don╒t forget to turn it on or 
  173. you will not hear anything.) The ╥use AudioMedia╙ item can be checked or unchecked. 
  174. It sets the internal clock rate correctly for the AudioMedia card. (If you check it and 
  175. you have a Sound Accelerator, it will run at a somewhat lower sampling rate, allowing 
  176. it to do a few more calculations per sample. But all of the pitches will be off by a factor 
  177. of about a major second.)
  178.  
  179. 2. Windows
  180.  
  181. 2.1 File Window
  182. Shows the devices and circuits that make up the file. You may select a device or circuit 
  183. and edit it by selecting its name and clicking on the appropriate ╥Edit╙ button. Double-
  184. clicking also does the job. You may also create a new device or circuit using the 
  185. appropriate button as well. You may delete devices or circuits by selecting them and 
  186. using the ╥Clear╙ menu item. NOTE: Editing a device that is already present in a 
  187. circuit is usually fatal! You may edit the device, but you should then do a ╥Save Device 
  188. As...╙ with a new name. You can then fairly easily zap and replace the old versions of 
  189. the device with the new version in all circuits that use it. 
  190.  
  191. 2.2 Device window
  192. Allows devices to be created or modified. Device pictures may be imported by using 
  193. ╥Paste╙. The picture should be in normal ╥PICT╙ format and all I/O pins MUST be 
  194. positioned exact multiples of 5 pixels away from the top left corner. The ╥Read Code╙ 
  195. button will read in a text file containing specifications of a device to be created ╥from 
  196. scratch╙. The format of this file is discussed later. The ╥Convert Circuit╙ button will 
  197. allow a circuit to be encapsulated to form a device. All ╥Input pin╙ and ╥Output pin╙ 
  198. devices and all controls will appear in the appropriate areas of the device window. I/O 
  199. pins and controls may be positioned inside the picture by selecting their names and 
  200. then using the mouse. Clicking on an existing pin or control in the device will 
  201. highlight the corresponding name, and allow the pin or control to be repositioned. 
  202. Don╒t forget to save the device before closing it!
  203.  
  204. 2.3 Circuit window
  205. The most important type of window since it contains the ╥active╙ circuits that produce 
  206. sound. The three icons in the top right corner allow drawing, deleting, and moving of 
  207. devices and connecting lines. (Except that moving is not implemented yet.) The 
  208. highlighting of these icons is flakey. The area below that is the ╥chute╙ where a copy of 
  209. the selected device appears. Dragging the device from the chute into the main part of 
  210. the window adds it to the circuit. The names of all available devices appears below the 
  211. chute. Connecting lines are simply drawn with the mouse. They must be vertical or 
  212. horizontal, and the system will automatically place everything on a 5-pixel grid. (So 
  213. you can be sloppy by ▒2 pixels.) Device pins will NOT be connected simply by placing 
  214. the devices so that their pins are coincident. You MUST use a connecting line.
  215.  
  216. 3 Operation of UniSon circuits and the supplied devices
  217.  
  218. 3.1 Basic concepts that you must know
  219. In a digital signal processor, all data is typically represented by fixed point real 
  220. numbers in the range -1▓X<1. All values, whether they represent amplitude, 
  221. frequency, angles, or whatever must be mapped into this range. All input pins, output 
  222. pins, and connecting lines in UniSon represent a 44.1 kHz stream of values in this 
  223. range (which I will refer to as ▒1 although +1 is actually not a valid value). When you 
  224. are using a value to represent frequency, the range ▒1 represents ▒22.05 kHz (the 
  225. Nyquist frequency). When talking about amplitude, I assume that the value 1 is 0 dB, 
  226. and therefore 0.5 is approximately -6 dB, etc. When representing angles, ▒1 is clearly 
  227. used to represent ▒180 degrees or ▒╣ radians. But these are simply different ways of 
  228. interpreting the same values. Underneath it all, everything is always in the range ▒1.
  229. Each device in UniSon represents a segment of machine code for a 56001 Digital 
  230. Signal Processor. It may have one or more I/O pins which allow it to be connected to 
  231. other devices. Each set of connected pins and ╥wires╙ in a circuit is assigned a memory 
  232. location in the DSP (not in the Mac itself) and that location will always hold the 
  233. current value of that digital signal (which will change at the rate of 44.1 kHz). Each 
  234. device may also contain local values or tables internally. (For example, a sine oscillator 
  235. stores the current angle value internally, and a envelope generator stores a table of 
  236. envelope segments.) Devices may also contain controls which are objects that may be 
  237. manipulated by the user. Each control may affect one or more I/O pins and/or internal 
  238. storage values or tables of the device containing it. When a control is manipulated by 
  239. the user, most of the work is done by the host Macintosh, which in turn will place 
  240. certain values directly into the appropriate DSP memory locations using fast 
  241. interrupts. Simple controls like scroll bars are effectively ╥free╙ as far as the DSP is 
  242. concerned. They take up no memory and insert no additional instructions into the DSP 
  243. code at all.
  244.  
  245. 3.2 The Scroll Bar and the Probe
  246. Create a circuit containing only a Scroll Bar connected to a Probe. This  will 
  247. illustrate the nature of data in UniSon (and DSP in general). The top half of the scroll 
  248. bar informs the user of its present value. The ╥units╙ box in the top right corner 
  249. determines how this value is displayed, and how the slider behaves. The actual value 
  250. produced by the scroll bar is actually a value in the range ▒1, as always. The choices 
  251. are:
  252. Dec :    Displays the value as a normal decimal number in the range ▒1.
  253. Hex:    Displays the actual 24-bit hexadecimal value of the output.
  254. Rad:    Displays the value in radians in the range ▒╣.
  255. Deg:    Displays the value in degrees in the range ▒180.
  256. Hz:    Displays the value as a frequency in the range ▒22.05 kHz. When this unit is 
  257. selected, the slider acts logarithmically, since this is more useful for 
  258. frequencies.
  259. dB:    Displays the value as an amplitude in dB. The output value 1.0 is treated as 0 
  260. dB, which means that 0.5 is -6.02 dB, 0.25 is -12.04 dB, etc. The output value 
  261. 0.0 is really minus infinity on a dB scale, but the arbitrary value -140 dB is 
  262. displayed. This unit also causes the slider to behave logarithmically.
  263. ▒16:    Displays the value as a number in the range ▒16. In other words, it pretends 
  264. that the decimal point follows the 4th bit. Don╒t forget that the actual value 
  265. produced is still ▒1, however. This just multiplies the value by 16 in the 
  266. display. However, this can be useful if the output value is eventually 
  267. multiplied by 16 by an appropriate device, so as to match the display. See the 
  268. FM circuit examples.
  269. The ╥sign╙ box in the top left corner may be used to restrict the output to only 
  270. positive values, only negative values, or signed values. Note that when a logarithmic 
  271. scale such as Hz or dB is chosen, this will automatically change to plus-only or minus-
  272. only since no logarithmic scale can possibly go through the value 0.
  273. The larger slider controls the value of the output directly using either a linear or 
  274. logarithmic scale. The smaller slider controls the sensitivity of the larger one. Every 
  275. pixel that the smaller slider moves to the right decreases the range of the larger slider 
  276. by a factor of 2. This allows a full 24 bits of precision to be used, with patience. By 
  277. clicking on the displayed value, you may also simply type in the desired value.
  278. The probe is simply the top half of a slider. The slider and probe may be set to any 
  279. combination of units so that you can see what is really going on. Try it.
  280.  
  281. 3.3 Other User-interface devices
  282. The other user-oriented I/O devices are the button, the MIDI devices, the spinner, 
  283. and the dial. The button is a simple on/off switch which produces a value of 0 or 
  284. (almost) 1. The dial is a circular control that may be manipulated with the mouse, 
  285. producing values in the range ▒1. The spinner is an output-only version of the dial 
  286. that may be used like a probe. It is useful because it shows graphically the circular 
  287. nature of all data in a DSP system. The MIDI devices (four of them) respond to MIDI 
  288. note, pitch bend, aftertouch, and controller messages. The small box containing the 
  289. channel number is a control which will allow you to select any MIDI channel, and the 
  290. MIDI controller devices contains a similar box to select the controller number. The 
  291. outputs of the MIDI note device represent note frequency, note velocity (a linear scale 
  292. 0..1), and a gate which indicates that a note is being played (a 0/1 value). Each MIDI 
  293. note device responds only to note on/note off events, and is monophonic. However, you 
  294. may have as may of these as you like, and if several are set to the same channel, 
  295. UniSon will assign incoming notes to them relatively intelligently to provide a 
  296. polyphonic system. This version of UniSon uses Apple╒s MIDI Manager to obtain the 
  297. incoming MIDI data. You must already have a copy of the MIDI Manager to use MIDI 
  298. with UniSon. If you don╒t, please let me know. 
  299.  
  300. 3.4 Sound generators
  301. There are various oscillators and other signal generators provided. The white noise 
  302. generator gives white noise at a specified amplitude. The ╥Sample&Hold╙ device will 
  303. give random output values which change at the specified frequency. For example, a 
  304. frequency value of 2 Hz will change the output twice per second to a new random 
  305. value. The sine oscillator will give a clean, linearly interpolated sine wave with a given 
  306. frequency, amplitude, and initial phase. For applications where the phase is 
  307. important, the ╥Sync Sine╙ device has an additional sync input which will force the 
  308. internal angle to 0 when the sync input changes from 0 to 1. When used with a MIDI 
  309. gate or button, this will cause all of the sine oscillators in an FM system, say, to begin 
  310. together at phase 0. There is also a ╥Control Sine╙ which is simply a combination of a 
  311. sine oscillator and two scroll bars. There are also square, pulse, sawtooth, and triangle 
  312. oscillators. Be aware, however, that these produce ╥perfect╙ waves to the best of their 
  313. ability. Such waves contain frequencies above the Nyquist frequency and will produce 
  314. aliasing. The ╥Wave Table╙ device allows the user to specify a wave using a table of 
  315. 256 24-bit values. Clicking on the small ╥wave╙ control will bring up a dialog box to let 
  316. the user enter harmonic/amplitude/phase values to build a wave. Waves may also be 
  317. saved and loaded from special wave files. 
  318.  
  319.  
  320. 3.5 Modifiers
  321. There are two envelopes and two filters provided. The ASR is a simple attack-
  322. sustain-release envelope with a gate input and an envelope output. The attack may be 
  323. either linear or exponential. The EG is an 8-segment general envelope in which each 
  324. segment may be log, linear, or exponential, or anywhere in between. This results in 
  325. fundamental problems when working with a digital system with fixed time and 
  326. amplitude resolutions. When you change one value, others may change to the nearest 
  327. value that can actually be achieved. Keep the ╥Mult╙ field at 0 (linear segments) when 
  328. in doubt. This thing needs work. Experiment with it.
  329. The devices ╥FOF╙ and ╥SOF╙ are simple first-order and second-order digital filters. 
  330. The ╥a╙ values are the coefficients of the numerator polynomial whose roots are the 
  331. zeroes and the ╥b╙ values are the coefficients of the denominator polynomial whose 
  332. roots are the poles. (You have to have a certain degree of familiarity with digital filters 
  333. to understand and use these devices.)
  334.  
  335. 3.6 Arithmetic
  336. There are devices which will perform addition and multiplication, which are fairly 
  337. self-explanatory. There is also a ╥16xy╙ device which will multiply two values and then 
  338. multiply the result by 16 (shifting it 4 bits left). This is useful in conjunction with the 
  339. ▒16 settings on the scroll bars at times. Note that the output of all of these devices is 
  340. cyclic and produces a result which is congruent to the ╥correct╙ result modulo 2, and is 
  341. in the range ▒1 (not 0..2). For example, adding 0.75 and 0.75 will give ╨0.5 which is 
  342. congruent to the correct answer (1.5) modulo 2, but lies in the proper range. Try 
  343. connecting two scroll bars to a ╥16xy╙ device and connecting a ╥spinner╙ and a ╥probe╙ 
  344. to its output. Play with it for awhile.
  345.  
  346. 3.7 I/O and device creation
  347. There is an ╥Output╙ device which will cause sound to be produced at the output of 
  348. the Sound Accelerator. For now, only one of these devices should be used, and stereo 
  349. outputs are not available. 
  350. There are also ╥Input Pin╙ and ╥Output Pin╙ devices which are used only to build 
  351. circuits which will subsequently be encapsulated to form a device. They do nothing but 
  352. give names to certain signals for use by the device editor.
  353.  
  354. 4. Creation of Devices from DSP code.
  355.  
  356. Besides encapsulating a circuit to form a device, you may also create one directly by 
  357. specifying its DSP code and all of the related information. This is not for the novice 
  358. user. You must be familiar with 56001 machine code, and have an assembler and 
  359. development system available to you, and preferably a simulator for testing also. To 
  360. create a UniSon device, you must then create a ╥Device File╙ such as the one shown 
  361. partially below (this is the ╥Control Sine╙ device). (The device files for all of the 
  362. supplied devices are included with UniSon. Look at them for more examples.)
  363. Pins
  364.   input phase
  365.   output sine
  366.  
  367. Storage
  368.   angle = 000000
  369.   freq  = 000000
  370.   ampl  = 000000
  371.   
  372. Controls
  373.   ScrollBar FreqCntl->freq
  374.   ScrollBar AmplCntl->ampl
  375.   
  376. Code
  377.   448000        <freq>  ; move freq,X0
  378.   568000        <angle> ; move angle,A
  379.   578040        <phase> ; add  X0,A     phase,B
  380.   540018        <angle> ; add  A,B      A1,angle
  381.   21A600                ; move B1,Y0
  382.   44F400 000080         ; move #>$000080,X0
  383.      etc. etc. etc.
  384.  
  385. The device file consists of four sections identified by keywords. The ╥Pins╙ section 
  386. begins with a line containing only the word ╥Pins╙ and it defines the I/O connections to 
  387. the device. Each line in this section consists of one of the keywords ╥input╙ or ╥output╙ 
  388. followed by a name for the pin chosen by the user. This name will appear later in the 
  389. device editor window in UniSon. The ╥Storage╙ section defines the internal memory 
  390. locations (local variables/tables) needed by the device. Each line consists of a name for 
  391. the location followed by an equal sign and its initial value(s). A table is formed simply 
  392. by listing more than one value, separated by blanks, or by using #tablesize. For 
  393. example ╥WaveTable = #256╙ could be used to allocate a 256-word table. All values 
  394. entered are in hexadecimal. The ╥Controls╙ section defined the controls which will be 
  395. provided to affect the operation of the device. Each line in this section contains the 
  396. type of control, a name for the control which will appear in the device window, the 
  397. symbol ╘->╒, and a list of the I/O pins and/or storage locations (or tables) that should be 
  398. affected by the control. The controls are really routines that form part of UniSon itself 
  399. and which run on the Macintosh host, and not of the DSP. (It is possible, but much 
  400. more difficult, to define your own kinds of controls as well.) Each type of control affects 
  401. a fixed number of DSP values or tables, and the correct number of items must follow 
  402. the ╥->╙ symbol. The type of controls currently defined are:
  403. Type ╥ScrollBar╙ is a standard scroll bar which has a single output which is set to 
  404. its current value.
  405. Type ╥Button╙ is a simple on/off button which has a single output that is set to 0 or 
  406. 1 (actually 7FFFFF hexadecimal).
  407. Type ╥EGcontrol╙ provides an envelope consisting of 8 general-purpose segments 
  408. and a release rate. It is intended for use only by the ╥EG╙ device, and will not be 
  409. discussed further here.
  410. Type ╥Spinner╙ is a circular indicator within a rectangular box which monitors the 
  411. state of a single signal line.
  412. Type ╥Dial╙ is a circular knob which may be manipulated by the user to input a 
  413. single value.
  414. Type ╥Probe╙ is the top half of a scroll bar which monitors rather than controls a 
  415. single signal value.
  416. Type ╥NameBox╙ is used to let the user give a name to a device. This is primarily 
  417. useful when encapsulating circuits to form devices since there must be a way of 
  418. identifying each control in the circuit uniquely. All devices which contain one or more 
  419. controls will automatically be given a NameBox by the device editor. It should not be 
  420. specified explicitly in a device file at all. A Name Box (or ╥Title╙) has a dynamic width 
  421. which always grows to the right edge of the device. Room must be left for it in the 
  422. device╒s picture.
  423. There are also controls for the four MIDI controls and the wave table, but these are 
  424. not really intended for use by the user.
  425. The final section of a device file is the code section which contains the actual DSP 
  426. code. Each line should contain a single 56001 DSP instruction in the form of one or two 
  427. 6-digit hexadecimal values. These should come from the output listing of your 56001 
  428. assembler. (There is no automatic mechanism for importing .lod files, but the code 
  429. must necessarily be quite small in order to be useful at 44.1 kHz so it is not a very big 
  430. job to type it in.) There are a lot of restrictions on the instructions and addressing 
  431. modes which may be used, the major one being that you may ONLY use an X memory 
  432. reference OR a Y memory reference, but NOT both, in each instruction. This is 
  433. because a signal may wind up in either X or Y memory and it cannot be predicted at 
  434. compile time. The XY and Long and other more powerful addressing modes are too 
  435. restricted to allow subsequent changes to a single instruction to be made without 
  436. completely rewriting the code. Contact the author via email for a more complete list of 
  437. restrictions if you are interested. 
  438. Each 56001 instruction that refers to a memory location that is actually an I/O pin 
  439. or a storage location, or which contains a jump address, must be patched by UniSon╒s 
  440. built-in linkage editor in order to become part of a circuit. Therefore, all such 
  441. instructions must be followed by the name of the pin or storage value and/or the jump 
  442. label, enclosed in angle brackets. (See the example above.) The instruction referenced 
  443. by a jump must contain the appropriate label, followed by a colon, at the start of the 
  444. line containing that instruction. (See the EG.dev file for example.) It is convenient to 
  445. place the original 56001 assembler source code on each line as a comment following a 
  446. semicolon, as in the example above. 
  447. The creation of such devices directly from 56001 code is not meant for novice users 
  448. (actually, it is not meant for anyone other than the author). Please contact me by 
  449. email for more details if you need them. The device files for all supplied devices are 
  450. provided, and they provide a fairly complete set of examples of what you can and 
  451. cannot do.
  452.  
  453. 5. Device Pictures
  454. There is not too much to say here. The picture for any UniSon device may be 
  455. created by your favorite drawing or painting program. It must them be copied and 
  456. pasted into the device window in UniSon. The only restriction is that the tips of all of 
  457. the I/O pins must be aligned to a 5-pixel grid relative to the top-left corner of the 
  458. picture. I have provided a HyperCard stack which contains the pictures of all of the 
  459. supplied devices, and whose background is the required 5-pixel grid. This makes the 
  460. creation of pictures fairly easy. One of the cards contains pictures of the various kinds 
  461. of controls. These may be placed freely (no grid restrictions). These are simply 
  462. ╥dummies╙ of course which should be used so that you can see what the device will 
  463. look like. That portion of the picture will be overwritten by a real, live control only 
  464. when it becomes part of an actual live circuit. These pictures also show you the exact 
  465. size and shapes of the controls, which are established by the corresponding routines 
  466. inside of UniSon and may not be changed. (Except for the title or name box, which 
  467. always expands as far as it can to the right.) 
  468.  
  469. 6. A Note About Speed
  470. When working at 44.1 kHz, there is not a lot that you can do in real time even with 
  471. a fairly powerful 20 MHz DSP chip such as the 56001 on the Sound Accelerator. At the 
  472. rate of 10.25 MIPS, there is enough time to execute a little more than 200 machine 
  473. language instrucions per sample. In a flexible system like UniSon in which virtually 
  474. anything can change, all values must be stored in memory locations and the 56001╒s 
  475. registers may only be used for temporary results within a device defined directly by 
  476. DSP code. This means that many of the powerful pipelining features of the 56001 go to 
  477. waste, and a lot of ╥MOVE╙ instructions are needed. The ╥Sine╙ module generates very 
  478. high quality linearly-interpolated sine waves with control over frequency, amplitude, 
  479. and phase. It take about 20 instructions to do this. This means that only 9 or 10 of 
  480. these devices may be used in a circuit before the Sound Accelerator loses its ability to 
  481. keep up. And the other devices, like adders and multipliers and envelope generators, 
  482. use up instructions, too. The amount that a single processor can do in this 
  483. environment is rather dissapointing. Don╒t expect to patch together a 4-operator FM 
  484. voice with 8-note polyphony. That would likely take 8 Sound Accelerators. I am 
  485. working on a multi-processor version of UniSon at the moment which would be 
  486. significantly more powerful without requiring anything extra from the user at all. 
  487.  
  488. 7. Communication and Requests
  489. This version of UniSon is a long way from being as complete as I would like it to be, 
  490. and there is a long list of additions and fixes waiting to be made. Please let me know of 
  491. specific needs, wants, problems, bugs, comments, suggestions, etc. at the address(es) 
  492. on the first page. If you need a specific kind of device, and if it is not too complex, and 
  493. if I can come up with the time or a graduate student, then please send a request. I can 
  494. create the appropriate device file for you. On the other hand, if you have 56001 
  495. expertise and create any useful or interesting devices, please mail them to me so that I 
  496. may distribute them to other users. If you want to get future (more complete) versions 
  497. of UniSon or new devices for it, please send me your address (email, preferably). 
  498.  
  499.  
  500. NEW FEATURES OF VERSION 0.62
  501.  
  502. 1. Midi Manager support has been added. You must have MIDI Manager installed 
  503. in your system and you must use the Patch Bay desk accessory or application to 
  504. connect something to UniSon. Please contact the author if you don╒t yet have MIDI 
  505. Manager. The types of messages supported are note on/off, channel pressure 
  506. (aftertouch), pitch bend, and all of the controllers (mod wheels, volume, joysticks, 
  507. pedals, etc.). You must know the controller number, however, and type it into the 
  508. dialog box that appears when the mouse is clicked on that number. (The ever-present 
  509. mod wheel is controller number 1, which is the default value.) 
  510. 2. There is a ╥wave table╙ oscillator which will produce any wave shape with up to 
  511. 128 harmonics using a 256-entry table. A dialog box allows you to specify wave shapes 
  512. by means of amplitude and phase values. The results may be stored in special UniSon 
  513. ╥wave╙ files, two of which are supplied as examples. If you wish to create these files 
  514. from scratch or convert other sources of waveshapes into this format, please contact 
  515. the author and I will supply you with the details of the required file format. 
  516. 3. Clicking on the value in a scroll bar now brings up a tiny dialog box allowing a 
  517. new value to be entered directly. (Its about time I added this one!)
  518. 4. Bigger circuit windows are now possible.
  519. 5. The Audio Media card is now supported by its own menu item under the 
  520. ╥Circuit╙ menu.
  521.  
  522. WISH LIST FOR UniSon:
  523.     There are a lot of unimplemented sections in UniSon, and a lot of missing 
  524. devices. Here are the main things on my ╥to do╙ list right now, in no particular order. 
  525. Please feel free to let me know which ones are high on your priority list, or suggest 
  526. additions to the list.
  527. A graphical envelope generator editor and the corresponding device (this one is 
  528. almost finished, actually).
  529. A selection of better higher order filters.
  530. A function device which will perform any function, up to a certain degree of 
  531. accuracy, using a 256-element function table and linear interpolation.
  532. Support for colour pictures and devices.
  533. Printing of circuits.
  534. Cut/Copy/Paste of circuits, subcircuits, devices, etc.
  535. Movement of devices and lines in a circuit.
  536. More flexible line drawing, allowing ╥L╙ shaped lines to be drawn in one operation. 
  537. Also allow deviecs to be connected directly without a line.
  538. Text fields for comments in a circuit.
  539. Stereo outputs.
  540. Automatic summing if several output devices appear in the circuit.
  541. Prompting for a save operation if changes have been mode and the user attempts to 
  542. close a circuit or device or file.
  543. More robust operation when memory space becomes low. UniSon, like many other 
  544. Macintosh applications, finds it difficult to handle all possible situations in 
  545. which memory suddenly runs out. When memory space becomes low, system 
  546. crashes are not uncommon. Make sure there is enough memory to avoid these 
  547. problems.
  548. An ╥undo╙ facility.
  549. Improved device selection using hierarchical pop-up menus instead of the current 
  550. ╥flat╙ scrolling list of titles. Also smaller and better (and reliable) icons for tool 
  551. selection.
  552. More devices, including a delay line device.
  553. Support for a multiprocessor to extend the capabilities of UniSon. I currently have a 
  554. card containing 4 56001 DSPs which I built specifically for UniSon. Perhaps 
  555. some commercially available card will be supported in the future. 
  556. Statistics on the amount of DSP time and space consumed by a given circuit.
  557. etc. etc. etc.